<% if session[:user_id] %>
<% @user =  User.find(session[:user_id])%>
  <div style="padding:0.5em 0.5em;">
    <%=@user.login%>,
    <img src="/images/welcome.gif" alt="欢迎回来" style="margin-bottom:-2px;" ></img>
    <div class="action_link" style="width:100%;padding-top:5px;">
      <ul id="my_toolbar">
        
        <li>
          <%= link_to "我的订单",'/store/mine',:title=>'我的订单',:class=>"action_order" %>
        </li>

        <li>
          <a href="/users/<%=@user.id%>/edit" class="action_edit_pw" title="修改资料">修改资料</a>
        </li>

        <li>
          <a href="/users/change_password/<%=@user.id%>" class="action_edit_pw" title="修改密码">修改密码</a>
        </li>

        <li>
          <a href="/sessions/destroy" class="action_logout">注销登录</a>
        </li>
      </ul>
    </div>
  </div>
<%else%>
  <% form_tag session_path do -%>
    <div style="width:180px;float:left;">
      <div style="width:130px;">
        <label for="login">账号</label><%= text_field_tag 'login','',:class=>'login_input' %>
        <label for="password">密码</label><%= password_field_tag 'password','',:class=>'login_input' %>
      </div>
      <%= image_submit_tag("login_button.gif",:id=>"login_button") %>
    </div>
    <div style="width:150px;padding-left:30px;padding-top:0px;">
      <a href="/users/new">注册</a> |
      <label for="remember_me" style="color:gray;">记住我</label>
      <%= check_box_tag 'remember_me' %>
    </div>
  <% end -%>
<%end%>

